package com.example.demo.mapper;

import com.example.demo.entity.Repetition;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface RepetitionMapper {
    @Insert("insert into repetition(id,name,college,major,term,detail,applytime,ispass) values(#{id},#{name},#{college},#{major},#{term},#{detail},#{applytime},#{ispass})")
    int add(Repetition r);

    @Select("select * from repetition where college=#{college}")
    List<Repetition> selectByCollege(String college);

    @Select("select * from repetition")
    List<Repetition> selectAll();

    @Select("select * from repetition where reid=#{reid}")
    Repetition selectByReId(int reid);

    @Update("update repetition set ispass=#{ispass} where reid=#{reid}")
    int update(String ispass,int reid);
}
